package gateway;

import okhttp3.ConnectionPool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class dd {
    @Qualifier("restTemplate10")
    @Autowired
    RestTemplate restTemplate;
    @Autowired
    ConnectionPool connectionPool;

    @RequestMapping("/test")
    public Object dd() {

        System.out.println("开始："+connectionPool.connectionCount());
        String s = restTemplate.getForObject("http://www.baidu.com", String.class);
        System.out.println("结束："+connectionPool.connectionCount());

        return s;
    }
}
